﻿@model GitCandy.Models.SshModel

@{
    ViewBag.Title = string.Format(SR.Shared_TitleFormat, SR.Account_SshKeys);
}

<h4>@SR.Account_SshKeys</h4>

@if (Model != null)
{
    <span>@SR.Account_SSH</span>
    <div id="choose_ssh"></div>

    <script type="text/javascript">
        var user = "@Model.Username";
        var chooser_params = [];
        chooser_params.push(
            {
                data: @Html.Raw(new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(Model.SshKeys)),
                container: "#choose_ssh",
                add_label: "@SR.Shared_Add",
                del_label: "@SR.Shared_Remove",
                use_ret_val: true,
                first_width: 5,
                add_action: { url: "@Url.Action("ChooseSsh", "Account")", query: function (item) { return { user: user, sshkey: item, act: "add" }; } },
                del_action: { url: "@Url.Action("ChooseSsh", "Account")", query: function (item) { return { user: user, sshkey: item, act: "del" }; } },
                action_array: []
            });
    </script>
}
@Html.ActionLink(SR.Shared_Back, "Detail", new { Name = Model.Username }, new { @class = "btn btn-default" })
